<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:body>

	<f:metadata>
		<f:viewParam name="index"
			value="#{dtPurchaseRequisitionLazyView.index}" />
	</f:metadata>

	<ui:composition template="/WEB-INF/templates/1000_layout.xhtml">

		<ui:define name="head">
			<title>Purchase Requisitions</title>
		</ui:define>

		<ui:define name="user_project_update_param">
			<ui:param name="updateForUserProjects" value="@form :menubarForm :tview" />
		</ui:define>
		
		<ui:define name="content">

			<p:tabView id="tview" rendered="#{not empty userSession.projectId}"
				activeIndex="#{dtPurchaseRequisitionLazyView.index}">
				<p:tab title="Open" id="prTab">
					<h:form id="formOpen">
						<ui:include
							src="/WEB-INF/templates/entity/purchaseRequisition.table.xhtml">
							<ui:param name="ajaxRowSelectUpdate" value=":formDlg:itemDetail" />
							<ui:param name="backingBean"
								value="#{dtPurchaseRequisitionLazyView}" />
							<ui:param name="lazyModel"
								value="#{dtPurchaseRequisitionLazyView.openLazyModel}" />
						</ui:include>
					</h:form>
				</p:tab>
				<p:tab title="For Approval">
					<h:form id="formApproval">
						<ui:include
							src="/WEB-INF/templates/entity/purchaseRequisition.table.xhtml">
							<ui:param name="ajaxRowSelectUpdate" value=":formDlg:itemDetail" />
							<ui:param name="backingBean"
								value="#{dtPurchaseRequisitionLazyView}" />
							<ui:param name="lazyModel"
								value="#{dtPurchaseRequisitionLazyView.pendingLazyModel}" />
						</ui:include>
					</h:form>
				</p:tab>
				<p:tab title="Approved">
					<h:form id="formApproved">
						<ui:include
							src="/WEB-INF/templates/entity/purchaseRequisition.table.xhtml">
							<ui:param name="ajaxRowSelectUpdate" value=":formDlg:itemDetail" />
							<ui:param name="backingBean"
								value="#{dtPurchaseRequisitionLazyView}" />
							<ui:param name="lazyModel"
								value="#{dtPurchaseRequisitionLazyView.approvedLazyModel}" />
						</ui:include>
					</h:form>
				</p:tab>
				<p:tab title="Archived">
					<h:form id="formArchived">
						<ui:include
							src="/WEB-INF/templates/entity/purchaseRequisition.table.xhtml">
							<ui:param name="ajaxRowSelectUpdate" value=":formDlg:itemDetail" />
							<ui:param name="backingBean"
								value="#{dtPurchaseRequisitionLazyView}" />
							<ui:param name="lazyModel"
								value="#{dtPurchaseRequisitionLazyView.archivedLazyModel}" />
						</ui:include>
					</h:form>
				</p:tab>
			</p:tabView>

			<h:form id="formDlg">
				<ui:include
					src="/WEB-INF/templates/entity/purchaseRequisition.table.dialog.xhtml">
					<ui:param name="backingBean"
						value="#{dtPurchaseRequisitionLazyView}" />
					<ui:param name="outcome" value="/pr/edit" />
				</ui:include>
			</h:form>

		</ui:define>

	</ui:composition>

</h:body>
</html>